package cn.test.my.excel.poi.convert;

import java.lang.reflect.Field;

import cn.test.my.excel.poi.annotation.SetCellStyle;


/**
 * Integer 转换
 *
 * @author summit
 * @since 2021/6/6 20:11
 */
public class IntegerConverter implements Converter<Integer> {

	@Override
	public Class<Integer> supportJavaTypeKey() {
		return Integer.class;
	}

	@Override
	public Integer convertToJavaData(Field filed, String rowData, SetCellStyle style)
			throws Exception {
		if (rowData == null || "".equals(rowData.trim())) {
			return null;
		}
		return Integer.parseInt(rowData);
	}
}
